package jia.editor;

import org.apache.log4j.Logger;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

//====================================================
/**
 * @author Alec Lanter
 */
public class ModuleEditorPanelMouseListener extends MouseAdapter{
    private ModuleEditorPanelController controller;
    private static final Logger log = Logger.getLogger(ModuleEditorPanelMouseListener.class);
    
    //====================================================
    /**
     */
    private ModuleEditorPanelMouseListener(){
        // GNDN
    }
    
    //====================================================
    /**
     * @param controller
     */
    public ModuleEditorPanelMouseListener(ModuleEditorPanelController controller){
        this.controller = controller;
    }
    
    //====================================================
    /**
     * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
     */
    public void mouseClicked(MouseEvent evt){
        controller.handleMouseClick(evt);
    }
    
    //====================================================
    /**
     * @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
     */
    public void mousePressed(MouseEvent evt){
        controller.setDragButton(evt.getButton());
    }
    
    //====================================================
    /**
     * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
     */
    public void mouseReleased(MouseEvent evt){
        controller.setDragButton(0);
    }
}
